﻿using UnityEngine;
using System.Collections;

public class CameraController : MonoBehaviour 
{
    public GameObject player;

    //we assume at the start of the game, we'll always be at the most left of the game Scene
    //so at the beginning, camera sure won't follow character
    public bool isFollowingCharacter = false;

    void Update()
    {
        if (isFollowingCharacter)
        {
            Vector3 newCameraPos = camera.transform.position;
            newCameraPos.x = player.transform.position.x;
            camera.transform.position = newCameraPos;
        }
    }
}
